﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Audio;

namespace XboxShmup
{
    public class Enemy : AnimatedSprite
    {

        public SpriteAnimation EnemyAnimation;
        public bool Active;
        public int Health = 1;
        public int Damage;
        public int movementSpeed;
        public int scoreValue;
        protected SoundEffect explosionSound;
        
        public int Width
       
        {
            get { return EnemyAnimation.frameWidth; }
        }
        public int Height
        {
            get { return EnemyAnimation.frameHeight; }
        }
        float enemyMoveSpeed;

        
        public Enemy(Game1 gameClass, int xPosition, int yPosition, int height, int width)
            : base(gameClass, xPosition, yPosition, height, width)
        {
            Initialize();
        }

        public override void Initialize()
        {
            Active = true;
            Health = 10;
            Damage = 10;
            enemyMoveSpeed = 16f;
            scoreValue = 100;
            base.Initialize();
        }

        public override void LoadContent()
        {
            explosionSound = gameClass.Content.Load<SoundEffect>("ExplosionSound");
            base.LoadContent();
        }
        

        public override void Update(GameTime gameTime)
        {
            if (position.X < -boundingBox.Width)
            {
                gameClass.Lose();
                bCleanUp = true;
            }
            base.Update(gameTime);
        }
        
        public override void DrawSprite(SpriteBatch spriteBatch)
        {
            base.DrawSprite(spriteBatch);
        }
    }

}
